package io.renren.modules.sp.dao;

import io.renren.common.dao.BaseDao;
import io.renren.modules.sp.dto.SpMatchItemDTO;
import io.renren.modules.sp.entity.SpMatchItemEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import cn.hutool.db.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;
import java.util.Map;

/**
* 赛项
*
* @author whc 15953295779@126.com
* @since 3.0 2023-04-20
*/
@Mapper
public interface SpMatchItemDao extends BaseDao<SpMatchItemEntity> {
    IPage<SpMatchItemEntity> selectPageVo(Page page, @Param(Constants.WRAPPER) QueryWrapper<SpMatchItemDTO> wrapper);

    Map<String,Object> itemTotal(@Param("matchItemId") Long matchItemId, @Param("type") String type);

    Map<String,Object> queryBymatchItemId(@Param("matchItemId") Long matchItemId);

    Map<String,Object> itemEntryTotal(@Param("matchId") Long matchId, @Param("matchItemId") Long matchItemId, @Param("type") String type);

    List<Map<String,Object>> queryUserHeader(@Param("type") String type, @Param("matchItemId") Long matchItemId);

    List<Map<String,Object>> queryLeaderHeader(@Param("matchId") Long matchId);

    List<Map<String,Object>> queryLeaderForm(@Param("matchId") Long matchId);
}